﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using TBR.Entities;
using System.Windows.Media.Imaging;

namespace TBR
{
    public partial class ProfileControl : UserControl
    {
        UserDetails m_Profile = null;
        public UserDetails Profile
        {
            get
            {
                return m_Profile;
            }
            set
            {
                m_Profile = value;
                LoadProfile();
            }
        }

        public ProfileControl()
        {
            InitializeComponent();
        }

        private void LoadProfile()
        {
            t_Name.Text = String.Format("{0}, {1}", m_Profile.Name, m_Profile.Age);
            t_State.Text = m_Profile.Details.State;
            i_Avatar.Source = new BitmapImage(new Uri(m_Profile.ImgUrl, UriKind.RelativeOrAbsolute));
            t_AboutMyself.Text = m_Profile.Details.AboutMyself;


         


        }
    }
}
